package com.example.designpatterns.Strategy.Cash;

/**
 * @author HUAWEI
 * 收费工厂
 */
public class CashFactory {
    public static CashSuper createCashSuper(int discountType) {
        CashSuper cs = null;
        switch (discountType) {
            case 1:
                cs = new CashRebate(0.8);
                break;
            case 2:
                cs = new CashRebate(0.7);
                break;
            case 3:
                cs = new CashReturn(300, 50);
                break;
            default:
                cs = new CashNormal();
        }
        return cs;
    }
}
